<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('帮助菜单树选择')}" />
    <th:block th:insert="~{include :: ztree-css}" />
</head>
<style>
    body{height:auto;font-family: "Microsoft YaHei";}
    button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
    <input id="treeId"   name="treeId"    type="hidden" th:value="${helpMenu?.id}"/>
    <input id="treeName" name="treeName"  type="hidden" th:value="${helpMenu?.name}"/>
    <div id="tree" class="ztree treeselect"></div>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <th:block th:insert="~{include :: ztree-js}" />
    <script th:inline="javascript">
        $(function() {
            var options = {
                url: "/help/tree.json",
                expandLevel: 2,
                onClick : zOnClick
            };
            $.tree.init(options);
        });

        function zOnClick(event, treeId, treeNode) {
            var treeId = treeNode.id;
            var treeName = treeNode.name;
            $("#treeId").val(treeId);
            $("#treeName").val(treeName);
        }
    </script>
</body>
</html>